
<%@ include file="/common/taglibs.jsp"%>
<!--分页查询共用的页面-->
<%@ include file="/common/common.jsp"%>

<%@ include file="/common/dateUtil.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>

<script>
	
	
function doViewIcon()
{
	var url = "<%=ApplicationPath%>/vehicleIconViewer.jsp";
	InfoWindow.openChildWindow(url,720,400);
}

function setIcon(iconName)
{
	if(iconName.length > 0)
	{
		var iconUrl = "<%=ApplicationPath%>/map/vehicleIcon/"+iconName;
		//alert(iconUrl);
		$("#mapIcon").attr("src",iconUrl);
	}
	$("#icon").val(iconName);//提交到后台的隐含字段

}


$().ready(function() {
		 $("#EntityForm").validate();
		  var defaultVehicleType = "${entity.defaultVehicleType}";
		 if(defaultVehicleType == "true")
		{
			 $("#defaultVehicleType").attr("checked",true);
		}
		 
		//ajax填充下拉框数据
		 $("#vehicleType").lookup({category:"VehicleType", selectedValue:"${entity.vehicleType}"});//终端类型
         $("#vehicleStatus").lookup({category:"VehicleStatus", selectedValue:"${entity.vehicleStatus}"});
         var icon = "${entity.icon}"; //标记的图标		
	     icon = icon.length == 0 ? "car_run.png" : icon;
	     setIcon(icon);

		 var mesasge = "${message}";
			if(mesasge.length > 0)
			{
				//保存成功后，刷新主窗口数据
				 window.parent.refreshTabPage();
			}
});
</script>
 <BODY>
	<form id="EntityForm" name="EntityForm" 
			action='<c:url value="/vehicleStateIconConfig/save.action" />' method="POST">
		<input type="hidden" id="entityId" name="entityId"
			   value="${entity.entityId}"/>
					<input type="hidden" name="icon" id="icon" 	value="${entity.icon}"/>
  <table width="100%"  class="TableBlock">
			<tr>
				<td colspan="4" style="font-weight: bold; background: #EFEFEF;">
					基本信息<span class="MessageFromServer">${message}</span></td>
			</tr>
			
			<tr>
				<td align=right>车辆类型:</td>
				<td align="left">
				   <select name="vehicleType" id="vehicleType" style="width:150px" class="required">  
				   </select>
				</td>
			</tr>
			
			<tr>
				<td align=right>车辆状态:</td>
				<td align="left">
				   <select name="vehicleStatus" id="vehicleStatus" style="width:150px" class="required">  
				   </select>
				</td>
			</tr>
			<tr>
			   <td  align=right>默认定义:</td>
				<td align="left"><input type="checkbox" name="defaultVehicleType" value="true" id="defaultVehicleType"  />(未定义车型都使用此定义)</td>
			</tr>
			
			
			<tr>
				<td align="right">图标:</td>
				<td align="left" >
					<img src="<%=ApplicationPath%>/map/vehicleIcon/car_run.png" id="mapIcon" /> <input type="button" value="请选择图标" onclick="doViewIcon();" />
				</td>

			</tr>
						
			<tr>
						<td colspan="4" align="center">
							<div align="center">
								<input type="submit" class="bar-button" value="保存">
							</div></td>
					</tr>
			
		
		</table>
 </BODY>
</HTML>
